package com.zzx.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.zzx.entity.TTest;
import com.zzx.service.TTestService;
import com.zzx.entity.ApiResult;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

/**
 * 测试 控制器
 * @author zzx
 * @since 2025-06-14
 */

@Api(tags = "测试 模块管理")
@RestController
@RequestMapping("/tTest")
public class TTestController {

@Resource
private TTestService tTestService;

@ApiOperation(value = "新增、编辑")
@PostMapping("/add")
public ApiResult add(@RequestBody TTest param) {
        tTestService.add(param);
    return ApiResult.ok();
}

@ApiOperation(value = "列表查询")
@PostMapping("/selectBy")
public ApiResult selectBy(@RequestBody TTest param) {
    return ApiResult.ok(tTestService.selectBy(param));
}

@ApiOperation("根据ID获取详情")
@GetMapping("/{id}")
public ApiResult getById(@PathVariable("id") String id) {
    return ApiResult.ok(tTestService.findById(id));
}

@ApiOperation(value = "删除")
@PostMapping("/deleteById")
public ApiResult deleteById(@RequestBody TTest param) {
        tTestService.deleteById(param);
    return ApiResult.ok();
}
}
